/**
 * Created by liyongliang on 15/9/23.
 */
var gulp = require('gulp');
var webpack = require('gulp-webpack');
var config = require('../config').scripts;
var handleErrors = require('../util/handleErrors');
var webpackConfig = require('../webpack.config');
var ifDevReload = require('../util/gulp-if-dev-reload');
var notify = require('gulp-notify');

gulp.task("webpack", function() {
	return gulp
		.src(config.src)
		.pipe(webpack(webpackConfig))
		.on('error', handleErrors)
		.pipe(gulp.dest(config.dest))
        .pipe(ifDevReload())
		.pipe(notify({
			message: 'Webpack任务完成更新~~'
		}));
});